﻿function SelectAll(gvID, cbAll, cbName) {
    $("#" + gvID).find("input[type='checkbox']").each(function () {
        var cb = $(this);
        if (cb.attr("id").indexOf(cbName) >= 0) {
            if (cbAll.checked)
                cb.attr("checked", true);
            else
                cb.attr("checked", false);
        }
    });
}